/**
 * Created by liubin on 2014/06/12.
 */
Ext.define('Order.view.OrderForm', {
    extend: 'Ext.form.Panel',
    xtype: 'orderform',
    config: {
        title: '选择商品',
        items: [
            {
                xtype: 'hiddenfield',
                // !!! name 不能为id,有bug
                // 导航按钮会出错
                name: 'item_id'
            },
            {
                xtype: 'panel',
                layout: {
                    type: 'vbox',
                    align: 'center'
                },
                items: [
                    {
                        xtype: 'image',
                        name: 'image',
                        height: 200,
                        width: 200
                    }
                ]
            },
            {
                xtype: 'textfield',
                name: 'name',
                label: '名称',
                disabled: true,
                disabledCls: 'readonly'
            },
            {
                xtype: 'textareafield',
                name: 'description',
                label: '详细',
                disabled: true,
                disabledCls: 'readonly'
            },
            {
                xtype: 'numberfield',
                name: 'price',
                label: '单价(元)',
                disabled: true,
                disabledCls: 'readonly'
                //tpl: new Ext.XTemplate('{price}元'),
                //tplWriteMode: 'overwrite'
                //data:{ price: 123 }
            },
            {
                xtype: 'spinnerfield',
                name: 'count',
                label: '数量',
                minValue: 1,
                stepValue: 1,
                inputCls: 'readonly'
            },
            {
                xtype: 'numberfield',
                name: 'amount',
                label: '总价(元)',
                disabled: true,
                disabledCls: 'readonly'
            }
//            {
//                xtype: 'toolbar',
//                style: 'background:whitesmoke ',
//                //docked: 'bottom',
////                scrollable: {
////                    direction: 'horizontal',
////                    directionLock: true
////                },
//                items: [
//                    { xtype: 'spacer' },
//                    {
//                        text: '提交',
//                        action: 'submit'
//                    }
//                ]
//            }
        ]
    }
});